﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NCS.IConnect.ApplicationContexts;

namespace JM.JCY.SharePointComponent.PersonalInformationDocument.PersonalInformationDocLeftMenu
{
    public partial class PersonalInformationDocLeftMenuUserControl : UserControl
    {
       protected void Page_Load(object sender, EventArgs e)
        {
            string sourceDirectory = this.Parent.AppRelativeTemplateSourceDirectory;    //Example:   ~/_CONTROLTEMPLATES/JM.OCP.SharePointComponent.Broadcast/CreateBroadcastsRole/
            string webPartName = sourceDirectory.Substring(sourceDirectory.TrimEnd('/').LastIndexOf('/') + 1).TrimEnd('/');

            switch (webPartName.ToLower())
            {
                case "selfresumerecord":
                    lbSelfResume.CssClass = "leftmenuSelected";
                    break;

                case "yearassessmentrecord":
                    lbYearAssessment.CssClass = "leftmenuSelected";
                    break;

                case "socialrelationpropertyrecord":
                    lbSocialRelation.CssClass = "leftmenuSelected";
                    break;

                case "educationandtrainingrecord":
                    lbEducationAndTraining.CssClass = "leftmenuSelected";
                    break;

                case "searchprofile":
                    lbSearchProfile.CssClass = "leftmenuSelected";
                    break;
            }

        }
    }
}
